Skip to content

Switch from Rye to UV, update outdated things, add init script#2

Merged
safurrier merged 30 commits intomainfrom
feature/switch-to-uv-update-stuff
Feb 23, 2025
Merged

Switch from Rye to UV, update outdated things, add init script#2
safurrier merged 30 commits intomainfrom
feature/switch-to-uv-update-stuff

Conversation

@safurrier
Copy link
Owner

Overview

This PR modernizes and enhances the Python project template with current best practices, improved tooling, and better user experience.

Key Changes

Development Environment

  • Switched to uv for faster, more reliable dependency management
  • Updated minimum Python version to 3.9
  • Added automatic pre-commit hook configuration
  • Improved virtual environment handling

Project Initialization

  • Added interactive project initialization script (make init)
  • Added flexible example code handling options:
    • Keep for reference
    • Create minimal placeholder
    • Remove completely
  • Added project metadata configuration
  • Automated git repository setup

Quality Assurance

  • Updated pre-commit hooks configuration
  • Added automatic hook installation for existing projects
  • Integrated modern tools:
    • ruff for linting and formatting
    • mypy for type checking
    • pytest with coverage reporting
  • Added CodeCov integration

Documentation

  • Updated README with clearer instructions
  • Added detailed pre-commit hooks description
  • Improved Python version requirements documentation
  • Updated GitHub Actions badge

Docker Support

  • Updated Dockerfile for modern Python development
  • Cleaned up docker-compose configuration
  • Removed references to non-existent files

Testing

The changes have been tested through:

  • Fresh project initialization
  • Existing project setup
  • Docker environment builds
  • CI/CD pipeline execution

Breaking Changes

  • Requires Python 3.9 or higher (previously 3.8)
  • Changed dependency management from pip to uv
  • Modified pre-commit hooks configuration

Migration

Existing projects using this template can update by:

  1. Running make clean
  2. Running make setup
  3. Updating their Python version if below 3.9

…nstead of `uv pip run` for all the test and quality check commands. This is the more appropriate approach since:

1. We're working in a project context
2. The tools need access to our project's code (especially pytest)
3. We want to use the project's dependencies and environment

The `-m` flag tells Python to run the module as a script, which is the recommended way to run these tools.

Would you like me to commit these changes?
@safurrier safurrier merged commit 2902a8b into main Feb 23, 2025
0 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant